<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="axios.js"></script>
    <script>
        axios.defaults.baseURL = 'http://localhost:3000/';
        // axios.get('adata').then(ret => {
        //     console.log(ret);
        // })

        async function queryData() {
            var ret = await axios.get('adata');
            console.log(ret.data);
            return ret.data;
        }
        queryData().then(data => {
            console.log(data);
        });

        async function num() {
            var ret = await new Promise(function (resolve, reject) {
                setTimeout(function () {
                    resolve('nihao')
                }, 1000)
            });
            console.log(ret);
            return ret;
        };
        num().then(data => {
            console.log(data);
        })
    </script>
</body>

</html>